/**
 *  iBizSys 5.0 机器人生产代码（不要直接修改当前代码）
 *  http://www.ibizsys.net
 */
package com.sa.ibiz.demo.srv.demo.dao;

import net.ibizsys.paas.db.IDBDialect;
import net.ibizsys.paas.core.IDataEntity;
import net.ibizsys.paas.util.StringHelper;
import net.ibizsys.paas.core.IDEDBCallContext;
import net.ibizsys.paas.db.DBCallResult;
import net.ibizsys.paas.demodel.IDataEntityModel;
import net.ibizsys.paas.demodel.DEModelGlobal;
import net.ibizsys.paas.dao.DAOGlobal;
import net.ibizsys.paas.dao.IDAO;
import net.ibizsys.paas.entity.IEntity;
import javax.annotation.PostConstruct;
import org.springframework.stereotype.Repository;

import com.sa.ibiz.demo.srv.demo.demodel.IBZ5StorageDEModel;
import com.sa.ibiz.demo.srv.demo.entity.IBZ5Storage;
import com.sa.ibiz.demo.srv.demo.dao.IBZ5HARDWAREDAO;
import com.sa.ibiz.demo.srv.demo.entity.IBZ5HARDWARE;
/**
 * 实体[IBZ5Storage] DAO对象
 */
@Repository
public class IBZ5StorageDAO extends com.sa.ibiz.demo.srv.MyTestSysSysDAOBase<IBZ5Storage> {

    private static final long serialVersionUID = -1L;

    public static final String DATAQUERY_DEFAULT = "DEFAULT";

    public IBZ5StorageDAO() {
        super();

    }

    @PostConstruct
    public void postConstruct() throws Exception {
        DAOGlobal.registerDAO(getDAOId(), this);
    }

    /* (non-Javadoc)
     * @see net.ibizsys.paas.dao.DAOBase#getDAOId()
     */
    @Override
    protected String getDAOId() {
        return "com.sa.ibiz.demo.srv.demo.dao.IBZ5StorageDAO";
    }

    private IBZ5StorageDEModel iBZ5StorageDEModel;

    /**
    * 获取实体[IBZ5Storage]模型对象
    * @return
    */
    public  IBZ5StorageDEModel getIBZ5StorageDEModel() {
        if(this.iBZ5StorageDEModel==null) {
            try {
                this.iBZ5StorageDEModel = (IBZ5StorageDEModel)DEModelGlobal.getDEModel("com.sa.ibiz.demo.srv.demo.demodel.IBZ5StorageDEModel");
            } catch(Exception ex) {
            }
        }
        return this.iBZ5StorageDEModel;
    }

    /*
     * (non-Javadoc)
     * @see net.ibizsys.paas.dao.DAOBase#getDEModel()
     */
    @Override
    public  IDataEntityModel getDEModel() {
        return this.getIBZ5StorageDEModel();
    }


    private IBZ5HARDWAREDAO iBZ5HARDWAREDAO;

    /* (non-Javadoc)
     * @see net.ibizsys.paas.dao.DAOBase#getInheritDEDAO()
     */
    @Override
    protected  IDAO  getInheritDEDAO() {
        if(this.iBZ5HARDWAREDAO==null) {
            try {
                this.iBZ5HARDWAREDAO= (IBZ5HARDWAREDAO)DAOGlobal.getDAO("com.sa.ibiz.demo.srv.demo.dao.IBZ5HARDWAREDAO",this.getSessionFactory());
            } catch(Exception ex) {
            }
        }
        return this.iBZ5HARDWAREDAO;
    }

    /**
     * 填充继承实体数据信息
     * @param et
     * @throws Exception
     */
    @Override
    protected void fillInheritEntity(IBZ5Storage et)throws Exception {
        super.fillInheritEntity( et);

        IBZ5HARDWARE iBZ5HARDWARE =  (IBZ5HARDWARE)et;
        iBZ5HARDWARE.setIBZ5HARDWAREId(et.getIBZ5StorageId());
        if(et.isIBZ5StorageNameDirty())
            iBZ5HARDWARE.setIBZ5HARDWAREName(et.getIBZ5StorageName());
        iBZ5HARDWARE.set(IBZ5HARDWARE.FIELD_IBZ5HARDWARETYPE,"Storage");
    }


}